OBJECT | NN n/a IE 4 DOM 1 | ||
The OBJECT object reflects the OBJECT element. This is an updated way of embedding other media and external data into a document (through a plugin or ActiveX control). | |||
HTML Equivalent<OBJECT> | |||
Object Model Reference
|
accessKey | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
A single character key that brings focus to the element. The browser and operating system determine whether the user must press a modifier key (e.g., Ctrl, Alt, or Command) with the access key to bring focus to the element. In IE 4/Windows, the Alt key is required, and the key is not case sensitive. Not working in IE 4/Mac. | |||
Exampledocument.all.myObject.accessKey = "n" | |||
Value Single alphanumeric (and punctuation) keyboard character. | |||
|
align | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Defines how the element is aligned relative to surrounding text content. Most values set the vertical relationship between the element and surrounding text. For example, to align the bottom of the element with the baseline of the surrounding text, the align property value would be baseline. An element can be "floated" along the left or right margin to let surrounding text wrap around the element. | |||
Exampledocument.all.myObject.align = "absmiddle" | |||
Value Any of the following alignment constant values (as a string): absbottom | absmiddle | baseline | bottom | right | left | none | texttop | top. | |||
|
altHtml | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
HTML content to be displayed if the object or applet fails to load. This can be a message, static image, or any other HTML that best fits the scenario. There are inconsistencies in Internet Explorer with regard to this property's casing. The Win32 version requires altHtml; the Mac version requires altHTML. | |||
Exampledocument.all.myObject.altHtml = "<IMG SRC='objectAlt.gif'>" | |||
Value Any quoted string of characters, including HTML tags. | |||
|
classid | NN n/a IE 4 DOM 1 | ||
Read-only | |||
The URL of the object's implementation. In Internet Explorer, the URL can point to the CLSID directory (with a clsid: URL) that stores all the IDs for registered ActiveX controls, such as DirectAnimation. Be aware that there is a discrepancy in the case of this property name in Internet Explorer 4: Win32 requires classid; the Macintosh version requires classID. The DOM leaves the read/write or read-only status of this property to the discretion of the browser. | |||
Exampleif (document.all.soundObject.classid == "clsid:83A38BF0-B33A-A4FF-C619A82E891D"){ } | |||
Value String. | |||
|
code | NN n/a IE 4 DOM 1 | ||
Read-only | |||
The name of the Java applet class file set to the CODE attribute of the OBJECT element. | |||
Exampleif (document.all.clock.code == "Y2Kcounter.class") { } | |||
Value Case-sensitive (usually) applet class filename as a string. | |||
|
codeBase | NN n/a IE 4 DOM 1 | ||
Read-only | |||
Path to the directory holding the class file designated in either the CODE or CLASSID attribute. The CODEBASE attribute does not name the class file, just the path. | |||
Exampleif (document.all.clock.codeBase == "classes") { } | |||
Value Case-sensitive pathname, usually relative to the directory storing the current HTML document. | |||
|
codeType | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
An advisory about the content type of the object referred to by the CLASSID attribute. A browser might use this information to assist in preparing support for a resource requiring a multimedia player or plugin. If the CODETYPE property is set to an empty string, the browser looks next for the TYPE attribute setting (although it is normally associated with content linked by the DATA attribute URL). If both attributes have no (or empty) values set, the browser gets the content type information from the resource as it downloads. | |||
Exampledocument.all.gameTime.codeType = "application/x-crossword" | |||
Value Case-insensitive MIME type. A catalog of registered MIME types is available from ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/. | |||
|
data | NN n/a IE 4 DOM n/a | ||
Read-only | |||
URL of a file containing data for the OBJECT element (as distinguished from the object itself). Relative URLs are calculated relative to the CODEBASE attribute if one is assigned; otherwise, the URL is relative to the document's URL. | |||
Examplevar objDataURL = document.all.soundEffect.data | |||
Value A complete or relative URL as a string. | |||
|
dataFld | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to associate a remote data source column name to an OBJECT element attribute determined by properties set in the object. A DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.myObject.dataFld = "linkURL" | |||
Value Case-sensitive identifier of the data source column. | |||
|
dataSrc | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.all.myObject.dataSrc = "#DBSRC3" | |||
Value Case-sensitive identifier of the data source. | |||
|
form | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns a reference to the FORM element that contains the current element (if any). This property is appropriate only if the object is acting as a form control. Not available in the Macintosh version. | |||
Value Object reference. | |||
|
height, width | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The height and width in pixels of the element. Changes to these values are immediately reflected in reflowed content on the page. | |||
Exampledocument.all.myObject.height = 250 | |||
Value Integer. | |||
|
hspace, vspace | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The pixel measure of horizontal and vertical margins surrounding an OBJECT element. The hspace property affects the left and right edges of the element equally; the vspace affects the top and bottom edges of the element equally. These margins are not the same as margins set by style sheets, but they have the same visual effect. | |||
Exampledocument.all.myObject.hspace = 5 document.all.myObject.vspace = 8 | |||
Value Integer of pixel count. | |||
|
name | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The identifier associated with the OBJECT element. If the object should be one that goes inside a form, the name property is submitted as one-half of the name/value pair when the form is submitted to the server. | |||
Exampledocument.all.myObject.name = "company" | |||
Value Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. | |||
|
object | NN n/a IE 4 DOM n/a | ||
Read-only | |||
A reference to a wrapper around an object to allow access to document object model properties of the OBJECT element when the names may be confused with internal property naming of the object. For example, if the code loaded into an OBJECT element had a property named hspace, the script reference document.all.reader.hspace would retrieve that internal property, rather than the hspace property of the HTML element. The object property wrapper tells the JavaScript interpreter to get the property from the HTML element without diving into the external object's code. | |||
Examplevar objCode = document.all.reader.object.code | |||
Value Object reference. | |||
|
readyState | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Returns the current download status of the embedded content. This property provides a more granular way of testing whether a particular downloadable element is ready to be run or scripted instead of the onLoad event handler for the entire document. As the value of this property changes during loading, the system fires an onReadyStateChange event. | |||
Exampleif (document.all.myObject.readyState == 4) { } | |||
Value Unlike the document object's version of this property, the OBJECT object's values are integers. As can best be determined: 0 means uninitialized; 1 means loading; and 4 means complete. | |||
|
tabIndex | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether. Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields. | |||
Exampledocument.all.myObject.tabIndex = 6 | |||
Value Integer. | |||
|
type | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
An advisory about the MIME type of the external data to be loaded into the object. The browser looks to the type property value if the codeType property is null. | |||
Exampleif (document.all.myObject.type == "image/jpeg") { ... } | |||
Value Case-insensitive MIME type. A catalog of registered MIME types is available from ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/. | |||
|
Object | NN 4 IE J3 ECMA 1 |
An Object represents a customizable object. Use the Object object to generate "things" in your scripts whose behaviors are defined by custom properties and/or methods. Most typically, you start by creating a blank object with the constructor and then assign values to new properties of that object. Navigator 4 also lets you assign properties and values via a special literal syntax that also creates the Object instance in the process: var myObject = {prop1Name:prop1Value[, prop2Name:prop2Value[, ...propNName:propNValue]]}You can use objects as data structures for structured custom data in your scripts, much like creating an array with named index values. | |
Creating a Boolean Objectvar myObject = new Object() |
prototype | NN 4 IE J3 ECMA 1 |
A property of the static Object. Use the prototype property to assign new properties and methods to future instances of an Object created in the current document. See the Array.prototype property description for examples. | |
ExampleObject.prototype.author = "DG" | |
Value Any data, including function references. |
toString() | NN 4 IE J3 ECMA 1 |
Returns the object's value as a string data type. | |
Returned Value String. | |
Parameters None. |
valueOf() | NN 4 IE J3 ECMA 1 |
Returns the object's value. | |
Returned Value An object reference. | |
Parameters None. |